﻿@using MyWebProject.Models.Entity;
<div id="menuList" class="list-group">
    @{
        List<MENU> list = Model as List<MENU>;
        foreach (MENU menu in list)
        {
            <a href="javascript:void(0)" id="@menu.MENU_ID" onclick="selectMenu('@menu.MENU_ID')" class="list-group-item"><span class="glyphicon glyphicon-@menu.MENU_ICON" style="font-size: 15px">&nbsp;@menu.MENU_NAME</span></a>
        }
    }
    <input id="menuId" value="" style="visibility:collapse" />
</div>
<script>
    function selectMenu(menuId) {
        $("#menuId").val(menuId);
        $("#menuList a").each(function () {
            $(this).attr("class", "list-group-item");
        });
        $("#" + menuId).attr("class", "list-group-item active");
        $.post("Management/Grid?menuId=" + menuId, function (data) { $("#grid").html(data); });
    }
</script>